{extend name="base" /}

{block name="body"}
{php}use constant\Ota as OtaType;{/php}

<section class="content-header">
  <h1>
    SMTP邮箱配置
    <small>系统 配置</small>
  </h1>
  <ol class="breadcrumb">
    <li><a href="{:url('admin/index/index')}"><i class="fa fa-dashboard"></i> Home</a></li>
    <li class="active">微信接口参数配置</li>
  </ol>
</section>

<section class="content">
  <!-- 筛选框 -->
  <div class="box box-info">
    <div class="box-header with-border">
    <h3 class="box-title"><a href="https://packagist.org/packages/phpmailer/phpmailer" target="_blank">smtp配置说明</a></h3>
    </div>

    <form class="form-horizontal" method="post" id="search-form">
      <div class="box-body">
      <input type="hidden" name="id" value="{$id}">

        <div class="form-group">
          <label for="inputEmail3" class="col-sm-2 control-label">服务器</label>
          <div class="col-sm-10">
            <input type="text" name="smtp_server" value="{$info.smtp_server}"  class="form-control" placeholder="请输入服务器地址">
          </div>
          <span class="col-md-2"></span>
          <span class="col-md-8">邮件服务商的 SMTP 服务器地址</span>
        </div>

        <div class="form-group">
          <label for="input3" class="col-sm-2 control-label">端口</label>
          <div class="col-sm-10">
            <input type="text" name="smtp_port" value="{$info.smtp_port}" class="form-control" placeholder="">
          </div>
          <span class="col-md-2"></span>
          <span class="col-md-8">SMTP 邮件服务器的 TCP 连接端口</span>
        </div>

        <div class="form-group">
          <label for="input3" class="col-sm-2 control-label">用户名</label>
          <div class="col-sm-10">
            <input type="text" name="smtp_user" value="{$info.smtp_user}" class="form-control" placeholder="请输入32位公众号AppSecret（必填）">
          </div>
          <span class="col-md-2"></span>
          <span class="col-md-8">SMTP 邮件服务器所需身份验证的用户名</span>
        </div>

        <div class="form-group">
          <label for="input3" class="col-sm-2 control-label">密码</label>
          <div class="col-sm-10">
            <input type="password" name="smtp_password" value="{$info.smtp_password}" class="form-control" placeholder="">
          </div>
          <span class="col-md-2"></span>
          <span class="col-md-8">SMTP 邮件服务器所需身份验证的密码</span>
        </div>

        <div class="form-group">
          <label for="input3" class="col-sm-2 control-label">加密方式</label>
          <div class="col-sm-2">
              <div class="radio">
                <label>
                  <input type="radio" name="smtp_secure" {$info.smtp_secure == 'TSL' ? 'checked' : ''} value="TSL">&nbsp;&nbsp;&nbsp;&nbsp;TSL
                </label>
              </div>
            </div>
            <div class="col-sm-2">
              <div class="radio">
                <label>
                  <input type="radio" name="smtp_secure" {$info.smtp_secure == 'SSL' ? 'checked' : ''} value="SSL">&nbsp;&nbsp;&nbsp;&nbsp;SSL
                </label>
              </div>
            </div>

            <div class="col-sm-2">
              <div class="radio">
                <label>
                  <input type="radio" name="smtp_secure" {$info.smtp_secure == '' ? 'checked' : ''} value="">&nbsp;&nbsp;&nbsp;&nbsp;无
                </label>
              </div>
            </div>
        </div>

      </div>

      <div class="box-footer">
        <div class="row">
          <div class="col-md-12 text-right">
            <button type="button"  class="btn btn-info submit">修改</button>
          </div>
        </div>
      </div>

    </form>

  </div>

  <div class="box box-info">
  <div class="box-body">
    <div class="form-group">
      <label for="input3" class="col-sm-2 control-label">SMTP邮箱测试</label>
      <div class="col-sm-3">
        <input type="text" value=""  class="form-control mailbox-test" placeholder="请输入测试邮箱地址">
      </div>
      <div class="col-md-2">
        <button type="button" data-url="{:url('admin/SystemConfig/smtpTest')}"  class="btn btn-info send-btn">发送测试邮件</button>
      </div>
    </div>
  </div>
  </div>




</section>

{/block}

{block name="script"}
  <script type="text/javascript" src="__AJS__/system_config/smtp_set.js"></script>
{/block}